﻿<Window x:Class="Reactor.MiniManager.MainWindow"
				xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Controls="clr-namespace:Reactor.MiniManager.Controls" 
        Title="" Height="400" Width="220" Closing="Window_Closing">
	<Window.Resources>
		<ResourceDictionary>
			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="BottomPanelBackgroundBrush">
        		<GradientStop Color="White"/>
        		<GradientStop Color="#FF626262" Offset="0.976"/>
        	</LinearGradientBrush>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="TopPanelBackgroundBrush">
                <GradientStop Color="#FFB2B2B2"/>
                <GradientStop Color="White" Offset="0.73"/>
            </LinearGradientBrush>
        </ResourceDictionary>
	</Window.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Height="18" HorizontalAlignment="Stretch" VerticalAlignment="Center" Background="{StaticResource TopPanelBackgroundBrush}">
            <TextBlock Text="Reactor Cores" Margin="3" VerticalAlignment="Center" />
        </StackPanel>
        <ListBox x:Name="CoresList" Grid.Row="1" ItemsSource="{Binding Mode=OneWay, Path=Cores}" SelectedItem="{Binding ReactorCoreViewModel}" BorderThickness="0">
            <ListBox.ItemContainerStyle>
                <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                    <EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_DoubleClick"/>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding Mode=OneWay, Path=StatusIndicator}" Margin="3" />
                        <StackPanel Width="150" Margin="3,0,0,0">
                            <TextBlock Text="{Binding Mode=OneTime, Path=Name}" />
                            <TextBlock Text="{Binding Mode=OneTime, Path=Version}" FontSize="9" />
                        </StackPanel>
                        <Controls:ImageButton ImageSource="/Images/Download.png" Height="18" Command="{Binding Mode=OneTime, Path=AdoptCommand}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel Grid.Row="2" Height="18" HorizontalAlignment="Stretch" Background="{StaticResource BottomPanelBackgroundBrush}">
        	<TextBlock Text="{Binding Mode=OneWay, Path=StatusText}" Margin="3" />
        </StackPanel>
    </Grid>
</Window>
